/*
---------------------------------------------------------------------------------------
This source file is part of SWG:ANH (Star Wars Galaxies - A New Hope - Server Emulator)

For more information, visit http://www.swganh.com

Copyright (c) 2006 - 2010 The SWG:ANH Team
---------------------------------------------------------------------------------------
Use of this source code is governed by the GPL v3 license that can be found
in the COPYING file or at http://www.gnu.org/licenses/gpl-3.0.html

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
---------------------------------------------------------------------------------------
*/

#ifndef ANH_ZONESERVER_TANGIBLE_FOOD_H
#define ANH_ZONESERVER_TANGIBLE_FOOD_H

#include "Item.h"
#include "Buff.h"


//=============================================================================

class Food : public Item
{
    friend class ItemFactory;
    friend class FoodCommandMapClass;

public:

    Food();
    virtual ~Food();

    virtual void	prepareCustomRadialMenu(CreatureObject* creatureObject, uint8 itemCount);
    virtual void	handleObjectMenuSelect(uint8 messageType,Object* srcObject);
    void			handleFoodUse(Object* srcObject);

private:

    void			_handleUses_Remaining(PlayerObject* playerObject);
    //void			_handleHealth_Buff(PlayerObject* playerObject);
    //void			_handleMind_Buff(PlayerObject* playerObject);
    //void			_handleMask_Scent_Buff(PlayerObject* playerObject);
    void			_handleBuff(PlayerObject* playerObject);
    void			_handleInstant(PlayerObject* playerObject);


    bool			toDelete;
    uint32			mIcon;
    uint32			mDuration;
    Buff*			mBuff;

};

//=============================================================================


typedef void									(Food::*funcfoodPointer)(PlayerObject*);
typedef std::map<uint32,funcfoodPointer>		FoodCommandMap;
#define gFoodCmdMap								((FoodCommandMapClass::getSingletonPtr())->mCommandMap)

class FoodCommandMapClass
{
public:

    static FoodCommandMapClass*  getSingletonPtr() {
        return mSingleton;
    }
    static FoodCommandMapClass*	Init();


    ~FoodCommandMapClass();
    FoodCommandMapClass();

    FoodCommandMap						mCommandMap;

private:

    static bool							mInsFlag;
    static FoodCommandMapClass*			mSingleton;

};

#endif

